package LimitedTimeGame.Day_0328.night;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author zxc
 * @date 2023/03/28 19:29
 **/
public class IsBaidu {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String target = "Baidu";
        for(int i = 0 ; i < n ; i++){
            String str = scanner.next();
            System.out.println(isBaidu(target, str));
        }
    }

    private static String isBaidu(String target, String str) {
        List<Character> list = new ArrayList<>();
        for (char ch : str.toCharArray()) {
            list.add(ch);
        }
        if(list.size() != target.length()){
            return "No";
        }
        for (char ch : target.toCharArray()) {
            if(!list.contains(ch)){
                return "No";
            }
        }
        return "Yes";
    }
}
